﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections.ObjectModel;

namespace Medianamik.UI.ImportExportManagement
{
    public class RecordType
    {
        public RecordType(String name)
        {
            if (String.IsNullOrEmpty(name))
                throw new ArgumentException("The name of a Record Type cannot be null or empty.", "name");

            _name = name;
        }

        public RecordType(String name, Guid? id)
            : this(name)
        {
            if (id == null || id == Guid.Empty)
                id = Guid.NewGuid();
            else
                Id = id;
        }

        public Guid? Id { get; set; }

        public String Name
        {
            get { return _name; }
            set
            {
                if (String.IsNullOrEmpty(value))
                    throw new ArgumentException("The name of a Record Type cannot be null or empty.", "Name");

                _name = value;
            }
        }
        string _name;

        public RecordTypePropertyCollection Properties { get { return _properties; } }
        RecordTypePropertyCollection _properties = new RecordTypePropertyCollection();
    }
}
